const app = getApp();
Page({
	data:{
		rule_on:'',
		hd_on:'type_1',
		list_type:' ',
		g_iphone: '',
	},
	fan_click:function(){
	  wx.navigateBack({
		  delta:1
	  })
	},
	sum_click:function(e){
		  if(e.target.dataset.id == '1'){
					this.setData({
						hd_on:'type_1',
						list_type:''
					})
			}else{
				this.setData({
					hd_on:'type_2',
					list_type:'type_2'
				})
			}
	},
	onReady:function () {
			app.SystemInfo(this)
	},
  onLoad: function () {
    var that = this;
    app.request(app.apiDomain + 'index.php?c=user&a=pointstat', [], function (res) {
        console.log(res);
      if (res.data.status == '1') {
        that.setData({
          point: res.data.data
        });
      }
    });
		
		//公告
		app.request(app.apiDomain + "index.php?c=mall&a=notice", {
			type:'gold'
		}, function (res) {
			// console.log(res.data.data)
			that.setData({
				gao:res.data.data
			});
		});
    /**
     * 积分明细接口
     * type=2 为支出项
     */
    app.request(app.apiDomain + 'index.php?c=user&a=pointrecord', {
		type: 1
	}, function (res)     {
      if (res.data.status == '1') {
        that.setData({
          incomelist: res.data.data.list
        });
      }
    });
    /**
     * 积分明细接口
     * type=2 为支出项
     */
    app.request(app.apiDomain + 'index.php?c=user&a=pointrecord',{
		type: 2
	}, function (res)    {
      if (res.data.status == '1') {
        that.setData({
          consumelist: res.data.data.list
        });
      }
    });
  },
	gao_click:function(){
		this.setData({
			gao_on:'on'
		})
	},
	gao_off:function(){
		this.setData({
			gao_on:''
		})
    },
    topUp(){
        console.log(234);
        wx.navigateTo({
            url: '../top_up/topUp?balance_point='+this.data.point.balance_point
        })
    },
  onShareAppMessage: function () {
    return app.onShareAppMessage();
  }  
})



